package com.lxp.userms.service.impl;

import com.lxp.userms.entity.Category;
import com.lxp.userms.mapper.CategoryMapper;
import com.lxp.userms.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;



@Service
public class CategoryServiceImpl implements CategoryService {
    @Autowired
    private CategoryMapper categoryMapper;

    @Override
    public List<Category> getAllCategories() {
        return categoryMapper.getAllCategories();
    }

    @Override
    public void addCategory(Category category) {
        categoryMapper.addCategory(category);
    }

    @Override
    public int deleteCategoryById(int id) {
        return categoryMapper.deleteCategoryById(id);
    }
}